/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.clinicariobamba.Controladores;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author xavier
 */
@ManagedBean
@ViewScoped
public class ControladorPruebas {

    /**
     * Creates a new instance of ControladorPruebas
     */
    public ControladorPruebas() {
    }
    public void mostrarMensaje (){
        try {
                FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
                        "Información", "Salio el mensajje");
                FacesContext.getCurrentInstance().addMessage(null, message);                                            
            
        } catch (Exception e) {
            FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
                    "Alerta!!", e.getMessage());
            FacesContext.getCurrentInstance().addMessage(null, message);
        }            
    }
}
